\contentsline {section}{\numberline {1}总体设计}{4}{section.1}%
\contentsline {section}{\numberline {2}功能介绍}{5}{section.2}%
\contentsline {subsection}{\numberline {2.1}待机模式}{5}{subsection.2.1}%
\contentsline {subsubsection}{\numberline {2.1.1}开机待机}{5}{subsubsection.2.1.1}%
\contentsline {subsubsection}{\numberline {2.1.2}主动待机}{6}{subsubsection.2.1.2}%
\contentsline {subsection}{\numberline {2.2}表情随心情的变化}{6}{subsection.2.2}%
\contentsline {subsection}{\numberline {2.3}环境感知}{7}{subsection.2.3}%
\contentsline {subsubsection}{\numberline {2.3.1}温湿度传感器}{7}{subsubsection.2.3.1}%
\contentsline {subsubsection}{\numberline {2.3.2}超声波传感器}{8}{subsubsection.2.3.2}%
\contentsline {subsection}{\numberline {2.4}定时安抚}{8}{subsection.2.4}%
\contentsline {subsection}{\numberline {2.5}心情系统}{9}{subsection.2.5}%
\contentsline {subsection}{\numberline {2.6}死亡系统}{9}{subsection.2.6}%
\contentsline {subsection}{\numberline {2.7}发声系统}{10}{subsection.2.7}%
\contentsline {subsection}{\numberline {2.8}游戏系统}{10}{subsection.2.8}%
\contentsline {subsection}{\numberline {2.9}存活时间统计}{11}{subsection.2.9}%
\contentsline {subsection}{\numberline {2.10}总结}{11}{subsection.2.10}%
\contentsline {section}{\numberline {3}代码实现}{11}{section.3}%
\contentsline {subsection}{\numberline {3.1}实现待机时的动画并且不执行中断}{11}{subsection.3.1}%
\contentsline {subsection}{\numberline {3.2}实现进行其他任务时打断并要求安抚}{13}{subsection.3.2}%
\contentsline {subsection}{\numberline {3.3}实现安抚后跳转回原任务}{14}{subsection.3.3}%
\contentsline {subsection}{\numberline {3.4}心情归零引起的死亡}{14}{subsection.3.4}%
\contentsline {subsection}{\numberline {3.5}矩阵键盘的拆分连接与去抖处理}{15}{subsection.3.5}%
\contentsline {subsection}{\numberline {3.6}蜂鸣器演奏}{16}{subsection.3.6}%
\contentsline {section}{\numberline {4}克服的难题}{17}{section.4}%
\contentsline {subsection}{\numberline {4.1}LCD频闪问题}{17}{subsection.4.1}%
\contentsline {subsection}{\numberline {4.2}长时间不安抚后卡死问题}{17}{subsection.4.2}%
\contentsline {subsection}{\numberline {4.3}delay函数参数必须使用常量问题}{17}{subsection.4.3}%
\contentsline {section}{\numberline {5}细节优化}{18}{section.5}%
\contentsline {subsection}{\numberline {5.1}前台任务切换优化}{18}{subsection.5.1}%
\contentsline {subsection}{\numberline {5.2}跨模块交互逻辑设计}{19}{subsection.5.2}%
\contentsline {section}{\numberline {6}反思总结}{19}{section.6}%
